/* 
 * Advanced Foundation Classes
 * Copyright (C) 2000/2004  Fabio Rotondo - Andrea Galimberti
 *  
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *  
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *  
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef AFC_EASYGUI_CLIST_H
#define AFC_EASYGUI_CLIST_H

#include <gtk/gtk.h>

#include "../easygui.h"
#include "../widgets.h"
#include "../glob_methods.h"
#include "../dnd.h"

// CList custom Attributes
#define AFC_EASYGUI_CLIST_ATTR_SHOW_TITLES	1

// CList custom variables
#define AFC_EASYGUI_CLIST_LAST_ROW		-1
#define AFC_EASYGUI_CLIST_ALL_ROWS		-2

#define AFC_EASYGUI_CLIST_SELECT		 1
#define AFC_EASYGUI_CLIST_UNSELECT		 0

// INTERNAL DEFINES - DO NOT USE IN YOUR CODE!
#define AFC_CLIST_STORE_DYNCLASS(widg,dc)	g_object_set_data ( G_OBJECT ( widg ), "dynamic_class_addr", dc )
#define AFC_CLIST_GET_DYNCLASS(widg,dc)		dc = g_object_get_data ( G_OBJECT ( widg ), "dynamic_class_addr" )
#define AFC_CLIST_GET_CLDATA(dc,cldata)		cldata = afc_dynamic_class_get_var ( dc, "cldata" )

struct easygui_clist_data
{
	GtkWidget	 * scrollwin;	// The ScrollWindow container
	GtkWidget 	 * clist;	// The CList Widget

	int		   columns;	// Number of columns

	int		   rows; 	// Number of rows in the CList

	GdkColor	   fore_color;	// Foreground color 
	GdkColor	   back_color;	// Background color

	int 		   current_row;	// Current row selected
};

typedef struct easygui_clist_data EGCListData;

DynamicClass * afc_easygui_internal_clist_new_instance ();
int afc_easygui_internal_clist_del_instance ( DynamicClass * );

// Signals Prototype
typedef int ( * EasyGUICListSignalFunc ) ( DynamicClass * dc, EasyGUIContext * context, void * info );
typedef void ( * EasyGUICListSelectSignalFunc ) ( DynamicClass * dc, EasyGUIContext * context, short selected, void * info );
typedef void ( * EasyGUICListColumnClickedFunc ) ( DynamicClass * dc, EasyGUIContext * context, int column, void * info );
#endif
